package com.yanqu.road.logic.bussiness.crossbanquet;

import com.yanqu.road.dao.impl.cross.party.CrossPartyDaoImpl;
import com.yanqu.road.dao.impl.cross.party.CrossPartyJoinDaoImpl;
import com.yanqu.road.dao.impl.cross.party.CrossPartyMemberDaoImpl;
import com.yanqu.road.entity.banquet.UserBanquetMember;
import com.yanqu.road.entity.banquet.cross.CrossBanquetData;
import com.yanqu.road.entity.banquet.cross.CrossBanquetMember;
import com.yanqu.road.entity.banquet.invitation.CrossUserPartyJoin;
import com.yanqu.road.entity.player.CrossUserBaseInfo;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class CrossPartyBusiness {
    public static boolean addCrossParty(CrossBanquetData party) {
        return new CrossPartyDaoImpl().add(party);
    }

    public static boolean updateCrossParty(CrossBanquetData party) {
        return new CrossPartyDaoImpl().update(party);
    }

    public static Map<String, CrossBanquetData> getCrossPartyMap() {
        return new CrossPartyDaoImpl().getRunningCrossBanquetMap();
    }

    public static Map<String, Map<Long, CrossBanquetMember>> getCrossPartyMemberMap() {
        return new ConcurrentHashMap<>();
    }

    public static Map<Long, List<CrossUserPartyJoin>> getCrossPartyJoinMap() {
        return new CrossPartyJoinDaoImpl().getUserBanquetJoinMap();
    }

    public static Map<Long, CrossBanquetMember> getCrossPartyMapByPartyId(String banquetId) {
        return new CrossPartyMemberDaoImpl().getCrossBanquetMemberMap(banquetId);
    }

    public static boolean addCrossPartyMember(CrossBanquetMember member) {
        return new CrossPartyMemberDaoImpl().add(member);
    }

    public static boolean updateCrossPartyMember(CrossBanquetMember member) {
        return new CrossPartyMemberDaoImpl().update(member);
    }

    public static boolean addCrossPartyJoin(CrossUserPartyJoin join) {
        return new CrossPartyJoinDaoImpl().add(join);
    }

    public static boolean updateCrossPartyJoin(CrossUserPartyJoin join) {
        return new CrossPartyJoinDaoImpl().update(join);
    }

    public static   Map<Long, CrossUserBaseInfo> getAllBanquetJoinUserBaseInfo(){
        return new CrossPartyJoinDaoImpl().getAllBanquetJoinUserBaseInfo();
    }

}
